home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************************/
- /* BlbMap.ucwx */
- /* */
- /* Copyright ©1998 by Dick Whiting */
- /* */
- /*------------------------------------------------------------------------*/
- /* Builds the client side MAP statements. Prompts for info. */
- /* Requires that GetPicSize.ucwx has been ENABLED. */
- /* See the UrbCedWWW Readme for a more complete description. */
- /**************************************************************************/
- /*
- $VER: 1.0 Copyright ©1998 by Dick Whiting
- */
-
-
- options results
- Address CYGNUSED
-
- lf='0A'x
-
- 'CEDTOFRONT'
-
- title='Select image for MAP'
- Call Bldpath
- if filename='' then exit
-
- 'TEXT' '<IMG SRC="'filename'"'
-
- Call 'Rexx/GetPicSize.ucwx'
- sizes=result
- if sizes='' then exit
-
- parse var sizes width height
-
- 'TEXT' ' BORDER="0" USEMAP="#UCWmap" ALT="">'||lf
-
- 'UP'
-
- 'GETNUMBER' 5 '"MAP Areas"' 1
- divs=strip(result)
- if divs=0 then exit
-
- 'GETSTRING' 'H' '"Enter orientation: H or V"'
- orient=upper(strip(result))
- select
- when orient='H' | orient='V' then nop
- when orient='RESULT' then exit
- otherwise do
- 'OKAY1' 'Invalid value for orientation'
- end
- end
-
- 'GETSTRING' 'R' '"Enter shape: R or C"'
- shape=upper(strip(result))
- select
- when shape='R' | shape='C' then nop
- when shape='RESULT' then exit
- otherwise do
- 'OKAY1' 'Invalid value for shape'
- end
- end
-
- 'TEXT' '<MAP NAME="UCWmap">'||lf
-
- if shape='R' then do
- x1=0
- x2=width-1
- y1=0
- y2=height-1
- end
- else do
- x1=0
- y1=0
- if orient='H' then do
- offx=(width/divs)%2
- offy=height%2
- end
- else do
- offx=width%2
- offy=(height/divs)%2
- end
- rad=min(offx,offy)
- end
-
- do i=1 to divs
- title='Select file for area '||i
- Call Bldpath
- select
- when orient='H' & shape='R' then do
- if i~=divs then x2=(i*width)%divs
- else x2=width-1
- 'TEXT' ' <AREA HREF="'filename'" ALT="" SHAPE="RECT" COORDS="'x1','y1','x2','y2'">'||lf
- x1=x2+1
- end
- when orient='V' & shape='R' then do
- if i~=divs then y2=(i*height)%divs
- else y2=height-1
- 'TEXT' ' <AREA HREF="'filename'" ALT="" SHAPE="RECT" COORDS="'x1','y1','x2','y2'">'||lf
- y1=y2+1
- end
- when orient='H' & shape='C' then do
- 'TEXT' ' <AREA HREF="'filename'" ALT="" SHAPE="CIRCLE" COORDS="'offx','offy','rad'">'||lf
- offx=offx+(width%divs)
- end
- when orient='V' & shape='C' then do
- 'TEXT' ' <AREA HREF="'filename'" ALT="" SHAPE="CIRCLE" COORDS="'offx','offy','rad'">'||lf
- offy=offy+(height%divs)
- end
- otherwise nop
- end
- end
-
- 'TEXT' '</MAP'||lf
-
- exit
-
- /**************************************************************************/
- /* Build relative pathing. Force SAVE if necessary. */
- /**************************************************************************/
- Bldpath:
-
- 'STATUS RESTNAME'
- rest=result
- if rest='' then do
- 'OKAY1' "You must save the file first"
- exit
- end
-
- 'STATUS FILENAME'
- fullfn=result
-
- path=substr(fullfn,1,pos(rest,fullfn)-1)
- 'CHANGE CURRENT DIRECTORY' path
-
- 'GETFILENAME' path '"'title'"'
- filename=result
- if filename='RESULT' then do
- filename=''
- end
- else do
- diff=compare(path,filename)
- path=substr(path,diff)
- filename=substr(filename,diff)
- if path~='' then filename='../'||filename
- end
-
- return
-
-